#!/bin/csh -f
set tilings=()
set tnames=()
set tinp=
set figopts=()
set dd=$DECAHOME/scripts
while ("$1" != "")
    switch ($1)
	case -tinp:
	    shift
	    set tinp="-tinp $1"
	breaksw
	case -nofig:
	    set figopts="-nofig"
	breaksw
	default:
	    set tilings=($tilings $1)
	    set tnames=($tnames $1:t)
	breaksw
    endsw
    shift
end
#echo thsums $tilings
@ j = 0
foreach i ($tilings)
#    echo thsums $i
    @ j++
    $dd/fig -obj $i "$tinp" "$figopts" | $dd/pth  >>.out
end
cat .out| awk '$0~/^ *\#/{if(x==""){print $0;x=1}}$0!~/^ *\#/{print $0}'
rm .out
##
